package cc.md888.app.web.controller;

import cc.md888.app.application.ip.IpInfoService;
import cc.md888.app.application.proxy.ProxyService;
import cc.md888.app.application.totp.TotpService;
import cc.md888.app.infr.ip.IpInfoVO;
import cc.md888.app.model.common.IpInfoCmd;
import cc.md888.app.model.common.TotpCodeVO;
import cc.md888.app.model.proxy.ProxyInfoCmd;
import cc.md888.app.utils.IPUtils;
import cc.md888.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Api(tags = "代理工具")
@RestController
@RequestMapping("/api/proxy")
public class ProxyController {

    @Autowired
    private ProxyService proxyService;


    /**
     * 获取代理信息
     * @param cmd
     * @return
     */
    @ApiOperation(("代理信息"))
    @PostMapping("/info")
    public Result<IpInfoVO> getProxyInfo(@RequestBody ProxyInfoCmd cmd){
        return Result.ok(
                proxyService.getProxyInfo(cmd)
        );
    }



}
